package org.dizena.common.db;

import java.util.List;

public interface CommonDao<T>
{

    T insert(T m);

    void delete(String id);

    void delete(String key, Object value);

    void delete(String[] keys, Object[] values);

    void update(T m);

    T findOne(String id);

    T findOne(String key, Object value);

    T findOne(String[] keys, Object[] values);

    List<T> findMany(String key, Object value);

    List<T> findMany(String[] keys, Object[] values);

    List<T> find(ByPageQuery<T> pageQuery);

    long count(ByPageQuery<T> pageQuery);

}